home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / docs / howto / updateGcc < prev    next >
Encoding:
Text File  |  1992-12-14  |  4.3 KB  |  151 lines

  1.  
  2.  
  3. It is a good idea to periodically update gcc to the latest release,
  4. so that you get all the bug fixes and new features.
  5.  
  6. 1.  Save the old version of the compiler.  The new version might
  7.     be flaky, so you want to be able to back out to the previous
  8.     version easily.
  9.  
  10.     The sources of the current distribution are kept in
  11.     /sprite/src/cmds/gcc/dist.  Move it to /sprite/src/cmds/gcc/dist-XXX
  12.     where `XXX' is the version number.  Create a new `dist' directory
  13.     to put the new stuff.
  14.  
  15.     IMPORTANT --> Make sure you also save a copy of the binaries.
  16.     This should include a copy of the frontends, and the backends for
  17.     each machine.  If you lose all working copies, then you cannot
  18.     generate a new compiler!  (However if this should accidently happen,
  19.     you can restore them from a dump tape.)
  20.  
  21.  
  22. 2.  Get the latest version of gcc.  To do this type
  23.  
  24.         ftp prep.ai.mit.edu
  25.  
  26.     When you are prompted for an id  Type `anonymous'.  When
  27.     it asks for a password, you can type anything because it
  28.     will just ignore it.
  29.  
  30.     Once you are logged in, type
  31.  
  32.     ftp> cd /u2/emacs
  33.     ftp> ls
  34.  
  35.     This will list the contents of the directory.  Look for a file
  36.     named something like `gcc-1.36.tar.Z'.  Make sure you get the
  37.     latest version.
  38.  
  39.     To download, type
  40.  
  41.     ftp> get gcc-1.36.tar.Z
  42.  
  43.     Since it is a big file, it will take a while to down load.  This
  44.     is a good opportunity to go eat lunch or something.
  45.  
  46.     One it is downloaded, type
  47.  
  48.     ftp> quit
  49.  
  50.     to disconnect.
  51.  
  52.  
  53. 3.  Uncompress the tar file.  To do this type
  54.  
  55.         uncompress gcc-1.36.tar.Z
  56.  
  57.  
  58. 4.  Un-tar the files by typing:
  59.  
  60.     tar xvf gcc-1.36.tar
  61.  
  62.  
  63. 5.  In the file /sprite/src/cmds/gcc/sprite there are a bunch
  64.     of files that have special modifications for sprite.  You
  65.     need to run rlog to find out what has been changed in these
  66.     files and then integrate those changes into the distribution.
  67.  
  68.     All changed files should be placed in gcc/sprite.  gcc/dist should
  69.     only contain the unadulturated distribution.
  70.  
  71.     See the end of this file for a list of special modifications of gcc
  72.     for sprite.
  73.  
  74.  
  75. 6.  Recompile the front end:
  76.  
  77.         cd /sprite/src/cmds/gcc
  78.     make clean
  79.     make mkmf
  80.     make
  81.  
  82.  
  83. 7.  Recompile the back ends for each machine type.  You need
  84.     to double check all the symbolic links.  Most of them should
  85.     point to /sprite/src/cmds/gcc/dist, but some of them will point
  86.     to the files in /sprite/src/cmds/gcc/sprite.
  87.  
  88.     cd /sprite/src/cmds/cc1.68k
  89.     make clean
  90.     make mkmf
  91.     make
  92.  
  93.  
  94. 8.  Test the compiler to make sure it works.  You can do this by
  95.     using the -B option to specify a different search path to find
  96.     the backends.  For instance
  97.  
  98.     sun3.md/gcc -B/sprite/src/cmds/cc1.68k/sun3.md foo.c
  99.  
  100.     will cause the compiler to use the new back end, rather than
  101.     the one in /sprite/lib/gcc/sun3.md.
  102.  
  103.     One very important test is to make sure the new compiler can
  104.     regenerate itself from scratch.
  105.  
  106.  
  107. 9.  Send mail to `sprite-users' so that everyone knows the compiler
  108.     is about to change.
  109.  
  110.  
  111. 10.  Install the new compiler.  Run `make install' in /sprite/src/cmds/gcc
  112.      and in /sprite/src/cmds/cc1.$MACHINE for each machine.
  113.  
  114.  
  115. 11. Make sure that everything still works.  Try compiling several different
  116.     commands.  Run them to make sure that they still work.  Try compiling,
  117.     and booting a new kernel.
  118.  
  119.  
  120.  
  121. -----------------------------------------------------------------------------
  122.  
  123. Here is a list of special compiler hacks to customize gcc for Sprite.
  124. This list is probably not up to date, so check in /sprite/src/gcc/sprite
  125. and look at the sources to be sure.
  126.  
  127.     Front end
  128.     ---------
  129.     The front end uses a file called `specs.h' that has specifications
  130.     for multiple machine types.  To specify a particular machine type,
  131.     use the -m flag.
  132.  
  133.     The front end invokes the preprocessor with both `sprite' and 
  134.     `unix' predefined.
  135.  
  136.  
  137.     Preprocessor
  138.     ------------
  139.     The preprocessor has been modified to search for include files in
  140.     machine dependent directories first.  
  141.  
  142.     __STDC__ can be undefined, so that lint can use the gnu preprocessor.
  143.  
  144.  
  145.     cc1 backend
  146.     -------
  147.     cc1 has been modified to recognize any static variable named `rcsid'.
  148.     If this variable is unused it will not complain.  This is so we can
  149.     use RCS without seeing zillions of warnings.
  150.  
  151.